import dbconn from "../dbconn";
import logger from "@/utils/log";

//刪除驗證碼超過兩分鐘
export default async function deleteValidCode(): Promise<void> {
  let sql =
    " delete UserValidCode where datediff(second,daterecord,getdate()) > 120 ";
  //   logger.warn("定時任務：刪除驗證碼數據")
  try {
    await dbconn.execute({ sql });
  } catch (err) {
    logger.error("Error--DeleteValidCode:" + err);
  }
}
